<?php

namespace api\modules\v1\models;

use api\modules\common\models\User;
use api\modules\v1\models\images\Images;
use api\modules\v1\models\market\MarketTrade;
use api\modules\v1\models\notice\Notice;
use api\modules\v1\models\notice\NoticeTrade;
use common\models\Functions;
use common\models\Status;
use Yii;
use yii\base\Exception;

/**
 * This is the model class for table "goods".
 *
 * @property int $id
 * @property string $name
 */
class Home extends Common
{
    //获取客服信息
    public function getServer() {
        $data = 'https://chat.kefu14.com/chat/h5/index.html?sub=202209131126261&uid=20220913112628148cb3ea801954d6fbc50fa2385da9ed6&wid=&type=appointed&history=0&aid=20220913112628148cb3ea801954d6fbc50fa2385da9ed6&p&hidenav=1';
        return Functions::formatRestAPI(0, '', $data);
    }

    //获取客服电话
    public function getConfig() {
        $config = static::getCommonByKey(['service_phone']);
        return Functions::formatRestAPI(0, '', $config);
    }

    //获取爱好信息
    public function getConfigInterests() {
        $config = Common::getCommonByKey('config_interests');
        $data = array_filter(explode(',',trim($config,',')));
        return Functions::formatRestAPI(0, '', $data);
    }
}